package com.lgy.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lgy.model.User;
import com.lgy.util.CommonConstant;

@Controller
public class LoginController extends BaseController {
	@RequestMapping("/login")
	public String login(HttpServletRequest request, User user) {
		this.setSessionUser(request, user);
		return "main";
	}
	
	@RequestMapping("/logout")
	public String logout(HttpServletRequest request) {
		request.getSession().removeAttribute(CommonConstant.USER_CONTEXT);
		return "login";
	}
}
